package com.cheng.example.java.basics.clone;

public class Hello implements Cloneable
{
    public void sayWorld()
    {
        System.out.println("Hello world!");

    }

    public static void main(String[] args)
    {
        Hello h1 = new Hello();
        try
        {
            Hello h2 = (Hello)h1.clone();
            h2.sayWorld();
        }
        catch (CloneNotSupportedException e)
        {
            e.printStackTrace();
        }
    }
}